home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ MSO Files in IE 1.xpl < prev    next >
Text File  |  2004-01-16  |  4KB  |  128 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="9"
  3. "COUNT"="1"
  4. "UIPATH 1"="Appearance\Files&Folders\Files"
  5. "UIPATH 2"="Internet\Internet Explorer\Files&Folders"
  6. "UIPATH 3"="Program Options\Microsoft Office\MS Office 2000\Common"
  7. "UIPATH 4"="Program Options\Microsoft Office\MS Office XP\Common"
  8. "UIPATH 5"="Program Options\Microsoft Office\MS Office 2003\Common"
  9. "NAME"="Internet Explorer hosted files"
  10. "VERSION"="2.16"
  11. "LANGUAGE"="VBScript"
  12. "TEXT 1"="Display inside Internet Explorer"
  13. "DESCRIPTION 1"="Internet Explorer 4.0 (and any version above) try to host Microsoft Office Files (e.g. XLS Files) inside the Internet Explorer window. "
  14. "DESCRIPTION 2"="For example, if you click a XLS file in Internet Explorer (IE), IE downloads the file and opens it in it's own Window. This is good feature if you only want to view the file but if you want to edit it, it's very annoying that you don't get the "full" Excel window."
  15. "DESCRIPTION 3"="A selected (tick-mark beside it) file means: Open in Internet Explorer. An unselected item (no tick-mark beside it) means: Open in own application."
  16. "AUTHOR"="Xteq Systems"
  17. "CONTACTURL"="http://www.xteq.com/"
  18. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  19. "COMMENT 1"="see Q162059 in MS KB"
  20.  
  21.  
  22. 'ONLY EDIT THE LINE BELOW !!!!
  23. '******************************************************************
  24. sVals=Array(".doc",".xls",".ppt",".prj",".pdf")
  25. '******************************************************************
  26.  
  27. sPath="HKLM\Software\Classes\"
  28. sValue="\BrowserFlags"
  29.  
  30.  
  31. SUB Plugin_Initialize
  32.  for i=0 to UBound(sVals)
  33.      sItem=sVals(i)
  34.  
  35.      'get file description
  36.      sP=sPath & sItem & "\@"
  37.      sBase=RegReadValue(sP)
  38.      if IsEmpty(sBase)=true then
  39.         'has no description, don't need to go any further
  40.         Call SetUI(i+1,sItem,true)
  41.      else 
  42.         'HKLM\Software\Classes\XX File\NeverShowEx          
  43.         sP=sPath & sBase & sValue 
  44.         if RegReadValue(sP)<>8 then
  45.            'Value is NOT 8 => open in IE
  46.            Call SetUI(i+1,sItem,true)
  47.         else
  48.            'Value is 8 => open in own application
  49.            Call SetUI(i+1,sItem,false)
  50.         end if
  51.      end if
  52.  next 
  53. END SUB
  54.  
  55.  
  56. Sub SetUI(ItemNr,Typ,Activated)
  57.     sDesc=GetFileDescription(Typ)
  58.     Call SetUIElement(ItemNr, sDesc & " (" & Typ & ")" )
  59.     Call SetUIElementEx(ItemNr,Activated)
  60. End Sub
  61.  
  62.  
  63.  
  64. 'VERSION 1.1
  65. 'returns the readable description for a file TYPE. Input is the
  66. 'raw file type (e.g. ".TXT"). 
  67. Function GetFileDescription(DotType)
  68.   sxd_BasePath="HKLM\Software\Classes\"
  69.  
  70.   sxd_Path=sxd_BasePath & DotType & "\@"
  71.   sxd_Val=RegReadValue(sxd_Path)
  72.  
  73.   if IsEmpty(sxd_Val)=true then
  74.      'extended description not found! return default
  75.      GetFileDescription="<UNKNOWN>"
  76.   else
  77.      'found, now get the "real" description
  78.      sxd_Path=sxd_BasePath & sxd_Val & "\@"
  79.      sxd_Name=RegReadValue(sxd_Path)
  80.      
  81.      if IsEmpty(sxd_Name)=true then
  82.         'argh! 
  83.         GetFileDescription="<UNKNOWN>"
  84.      else
  85.         GetFileDescription=sxd_Name
  86.      end if
  87.   end if
  88.  
  89. End Function
  90.  
  91.  
  92. 'Called when the Plugin should apply the changes
  93. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  94.  for i=0 to UBound(sVals)
  95.  
  96.      sItem=sVals(i)
  97.  
  98.      'get file description
  99.      sP=sPath & sItem & "\@"
  100.      sBase=RegReadValue(sP)
  101.      if IsEmpty(sBase)=true then
  102.         Call MsgError("Unable to set for type " & sItem & " as this type is not known on your PC.")
  103.      else
  104.         'HKLM\Software\Classes\XX File\NeverShowEx          
  105.         sP=sPath & sBase & sValue 
  106.         if GetUIElementEx(i+1)=true then
  107.            'open in IE
  108.            if RegValueExists(sP) then
  109.               Call RegDeleteValue(sP)
  110.            end if
  111.         else
  112.            'hide extension
  113.            Call RegWriteValue(sP,"8",2)
  114.         end if 
  115.      end if
  116.  
  117.  next 
  118.  
  119.  Call Logoff()
  120. END SUB
  121.  
  122.  
  123. 'Called when the Plugin is about to be removed from memory
  124. SUB Plugin_Terminate
  125. END SUB
  126.  
  127.  
  128.